<template>
    <div class="min-h-screen">
        <div class="max-w-[100%] mx-auto px-[100px] sm:px-6 lg:px-8 py-8">
            <div class="grid grid-cols-12 gap-8">
                <!-- 左侧布局 -->
                <div class="col-span-8">
                    <!-- 顶部轮播图部分 -->
                    <a-carousel class="mb-8" autoplay>
                        <div v-for="(item, index) in carouselItems" :key="index" class="w-[100%] relative">
                            <a-image :src="item.image" class="w-[100%] h-96 object-cover mx-auto" :alt="item.title" />
                            <div class="absolute bottom-0 left-0 right-0 bg-black bg-opacity-50 text-white p-4">
                                <h3 class="text-xl font-bold">{{ item.title }}</h3>
                                <div class="flex items-center mt-2 text-sm">
                                    <span class="mr-4"> <i class="far fa-clock"></i> {{ item.date }} </span>
                                    <span> <i class="far fa-eye"></i> {{ item.views }} </span>
                                </div>
                            </div>
                        </div>
                    </a-carousel>

                    <!-- 新闻列表 -->
                    <a-card class="mb-4" :bordered="false">
                        <template #title>
                            <div class="flex items-center space-x-2">
                                <a-space>
                                    <DownSquareOutlined class="text-purple-600" :id="`bottom-card-icon-titl-${i}`" />
                                </a-space>
                                <span>最新资讯</span>
                            </div>
                        </template>

                        <a-list :data-source="newsList" item-layout="vertical">
                            <template #renderItem="{ item }">
                                <a-list-item>
                                    <a-list-item-meta>
                                        <template #title>
                                            <div class="flex flex-col h-[200px]">
                                                <a-typography-title :level="4" class="!mb-2">{{ item.title }}</a-typography-title>
                                                <div class="flex items-center justify-between w-full mt-auto">
                                                    <a-space>
                                                        <EyeOutlined class="text-gray-600" />
                                                        <span class="text-gray-600">阅读量：{{ item.views }}</span>
                                                    </a-space>
                                                    <a-space>
                                                        <ClockCircleOutlined class="text-gray-400" />
                                                        <span class="text-gray-400 text-sm">{{ item.date }}</span>
                                                    </a-space>
                                                </div>
                                            </div>
                                        </template>
                                        <template #avatar>
                                            <!-- <a-avatar src="https://joeschmoe.io/api/v1/random" /> -->
                                            <a-image :width="250" :height="200" alt="logo" :src="item.image" class="object-cover rounded mr-4 flex-1" />
                                        </template>
                                    </a-list-item-meta>
                                </a-list-item>
                            </template>
                        </a-list>
                    </a-card>
                </div>

                <!-- 右侧热点区域 -->
                <div class="col-span-4">
                    <!-- 24H快讯 -->
                    <a-card class="mb-4 border-t-4 border-t-orange-500">
                        <template #title>
                            <a-space class="flex items-center justify-between px-3">
                                <a-space>24H快讯</a-space>
                                <a-button type="link" class="text-gray-500">查看更多</a-button>
                            </a-space>
                        </template>
                        <a-list :data-source="quickNews" size="small">
                            <template #renderItem="{ item }">
                                <a-list-item>
                                    <a-space class="flex justify-between items-center">
                                        <a-space class="text-gray-500 text-sm w-10">{{ item.time }}</a-space>
                                        <a-space class="text-sm flex-1 text-gray-500">{{ item.content }}</a-space>
                                    </a-space>
                                </a-list-item>
                            </template>
                        </a-list>
                    </a-card>

                    <!-- 24H热度 -->
                    <a-card class="mb-4 border-t-4 border-t-orange-500">
                        <template #title>
                            <div class="flex items-center justify-between px-3">
                                <a-space>
                                    <DownSquareOutlined :id="`bottom-card-icon-down-${i}`" />24H热度
                                </a-space>
                                <a-button type="link" class="text-gray-500">更多»</a-button>
                            </div>
                        </template>
                        <a-list :data-source="hotTopics" size="small">
                            <template #renderItem="{ item, index }">
                                <a-list-item>
                                    <a-space class="flex items-center w-full justify-between">
                                        <a-space class="flex items-center flex-1">
                                            <a-typography-text class="mr-4 font-bold" :class="{
                          'text-red-500': index === 0,
                          'text-orange-500': index === 1,
                          'text-yellow-500': index === 2,
                          'text-gray-500': index > 2,
                        }">{{ index + 1 }}</a-typography-text>
                                            <a-typography-text>{{ item.title }}</a-typography-text>
                                        </a-space>
                                        <a-space>{{ item.score }}<a-space class="text-orange-500 font-bold "> ↑</a-space></a-space>
                                    </a-space>
                                </a-list-item>
                            </template>
                        </a-list>
                    </a-card>
                    <!-- 一周热文 -->
                    <a-card class="mb-4 border-t-4 border-t-orange-500">
                        <template #title>
                            <div class="flex items-center justify-between px-3">
                                <a-space>
                                    <UpSquareOutlined :id="`bottom-card-icon-up-${i}`" />一周热文
                                </a-space>
                                <a-button type="link" class="text-gray-500">更多 ></a-button>
                            </div>
                        </template>
                        <a-list :data-source="articles" size="small">
                            <template #renderItem="{ item, index }">
                                <a-list-item>
                                    <div class="flex items-center w-full">
                                        <div class="bg-gray-100 flex items-center justify-center mr-2" :class="{'w-200': index === 0, 'w-6': index !== 0}">
                                            <a-image v-if="index === 0" :width="200" :height="120" alt="logo" src="https://picsum.photos/200/120" class="object-cover rounded mr-4 flex-1" />
                                            <span class="font-bold" :class="{
                          'text-white absolute left-6 top-2 px-2 bg-red-500': index === 0,
                          'text-orange-500': index === 1,
                          'text-yellow-500': index === 2,
                          'text-gray-500': index > 2,
                        }">{{ index + 1 }}</span>
                                        </div>
                                        <div class="flex-1 flex flex-col gap-2">
                                            <a-typography-text class="text-gray-600 hover:text-blue-500 cursor-pointer">{{ item.title }}</a-typography-text>
                                            <a-typography-text class="text-gray-600 hover:text-blue-500 cursor-pointer">211COIN</a-typography-text>
                                        </div>
                                    </div>
                                </a-list-item>
                            </template>
                        </a-list>
                    </a-card>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="jsx">
// 新闻列表数据
const newsList = ref([
    {
        title: '孙宇晨推出USDD 2.0将提供20%年化报酬率!',
        date: '2025-01-16',
        views: 2350,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: 'Pump.fun涉诉讼，美律所BurwickLaw发起集体诉讼！受害用户达千万名',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: 'BitMEX违反美国银行法、被判罚款1亿美元与缓刑两年!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: '多重利好支撑、瑞波币7年来首度飙破3美元!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: 'CPI缓和后市场转向贪婪、比特币暴涨冲破十万!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: '富兰克林发表Al agent报告:AI代理改变加密生态!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: '马来西亚有意加速数字金融新政策落地!与阿联酋及币安合作讨论',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: '泰国正考虑开放比特币ETF:公司可发行以自身债务支持的稳定币!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: 'Kaiko报告:因应尹锡悦戒严风波韩国大量避险资金涌入比特币!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: '摩根大通:Solana和XRP ETF通过首年有望吸引136亿美元资金!',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/800/400',
        avatar: 'https://picsum.photos/100/100',
    },
]);
const carouselItems = ref([
    {
        title: '孙宇晨推出USDD 2.0将提供20%年化质押率!',
        date: '2025-01-16',
        views: 2350,
        image: 'https://picsum.photos/1800/600',
        avatar: 'https://picsum.photos/100/100',
    },
    {
        title: 'Pump.fun涉诉讼，美律所BurwickLaw发起集体诉讼！受害用户达千万名',
        date: '2025-01-16',
        views: 2113,
        image: 'https://picsum.photos/1800/600',
        avatar: 'https://picsum.photos/100/100',
    },
]);
// 快讯数据
const quickNews = ref([
    {
        time: '14:14',
        content: 'CryptoQuant调研报告:超62%加密用户是拥有3年以上经验的“交易老炮”',
    },
    {
        time: '14:14',
        content: 'CryptoQuant 调研报告:超 62% 加密用户是拥有 3年以上经验的“交易老炮“',
    },
    {
        time: '14:06',
        content: '自11月以来针对Telegram恶意软件诈骗增长了20倍',
    },
    {
        time: '14:00',
        content: 'Abcoin交易所已上线ai16z代币，开启Al Agent投资新机遇',
    },
    {
        time: '13:56',
        content: 'OKx Web3钱包上线Fluid奖励金活动，参与可瓜分35,000 FLUID奖池',
    },
    {
        time: '13:45',
        content: '中央政法工作会议:司法部要主动研究提出立法建议，比如虚拟货币等新问题',
    },
    {
        time: '13:41',
        content: 'XRP在谷歌趋势的搜索热度再次超过BTC',
    },
]);

// 热点话题数据
const hotTopics = ref([
    {
        title: '萨尔瓦多总统新计划:全国每户安装比特个币挖矿节点、成本曝光!',
        score: '3450',
    },
    {
        title: 'USDC市值年增长率达78%、跑赢全球稳定币市场！监管落地及金融需求增长成...',
        score: '3344',
    },
    {
        title: '比特币会二次探底吗？渣打银行：BTC若失守9万美元恐再下杀10%！',
        score: '3450',
    },
    {
        title: '摩根大通:Solana和XRP ETF通过首年有个望吸引136亿美元资金!',
        score: '3344',
    },
    {
        title: '0XBTC币是什么币?0XBTC币怎么样?',
        score: '3450',
    },
]);
// 一周热文数据
const articles = ref([
    {
        title: '美国再添两州考虑投资比特币!酒厂Heritage计划建立比特币储备井接受.',
        score: '3450',
    },
    {
        title: 'Notional Labs:Luna暴跌元凶不是Do Kwon!',
        score: '3344',
    },
    {
        title: '收到黑USDT会怎么样?会冻结账户吗?',
        score: '3450',
    },
    {
        title: '联准会降息预期受限、美股回调、特朗普就职在即!分析师对BTC后市分析',
        score: '3344',
    },
    {
        title: '萨尔瓦多总统新计划：全国每户安装比特币挖矿节点、成本曝光！',
        score: '3450',
    },
]);
</script>

<style></style>